Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.x] Make revoking refresh tokens optional #1790

Draft
wants to merge 7 commits into
base: 13.x
Choose a base branch
from

Conversation

hafezdivandari
Copy link
Contributor

@hafezdivandari hafezdivandari commented Oct 1, 2024

This PR introduces a new Passport::$revokeRefreshTokens property, in line with the new GrantTypeInterface::revokeRefreshTokens() function added in oauth2-server v9.0 useful for safer token rotation.

Disabling refresh token revocation can be useful if you want the client to manually revoke the old refresh token only after it successfully receives the new access token and refresh token.

Consider the following scenarios:

Refresh Token Revocation Enabled (Default behavior)

  1. The client requests to refresh an access token.
  2. The old access token is revoked.
  3. The old refresh token is revoked.
  4. A new access token and refresh token are issued in response.
  5. The client loses network connection and does not receive the new access and refresh tokens.
  6. The client cannot use the old refresh token because it has already been revoked.
  7. Dead end!

Refresh Token Revocation Disabled

  1. The client requests to refresh an access token.
  2. The old access token is revoked.
  3. A new access token and refresh token are issued in response.
  4. The client loses network connection and does not receive the new access and refresh tokens.
  5. The client can use the old refresh token again to receive new tokens.
  6. The client manually requests the old refresh token's revocation after successfully receiving the new one.

Copy link

github-actions bot commented Oct 1, 2024

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant